
#ifndef _LINUX_SYSCALL_BARRIER_H
#define _LINUX_SYSCALL_BARRIER_H

#include <linux/linkage.h>
#include <linux/wait.h>

extern atomic_t next_id;
//extern spinlock_t g_lock;

typedef struct barrier_data
{
	atomic_t ID;
	atomic_t N;
	atomic_t ref_count;//most probably will be the current size of the queue
	
	spinlock_t barrier_lock;
	wait_queue_head_t wq_head;//list of processes waiting on this barrier
	// Will need more data
        struct list_head b_list_elem;
} barrier_data_t;

//List of Barriers created or that are existing at a given time
//this might need some refining


/*
typedef struct barrier_list
{
	spinlock_t list_lock;
	barrier_data_t* barrier;
  struct list_head list;
  //        LIST_HEAD(list);
} barrier_list_t;
*/

  //static LIST_HEAD(g_blist);

//extern barrier_list_t g_blist;
#endif
